﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ReasonInfo.aspx.cs" Inherits="ExamAnalysis.Manage.ReasonInfo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<style type="text/css">
        .x-grid-cell-fullName .x-grid-cell-inner {
            font-family : tahoma, verdana;
            display     : block;
            font-weight : normal;
            font-style  : normal;
            color       : #385F95;
            white-space : normal;
        }
        
        .x-grid-rowbody div {
            margin : 2px 5px 20px 5px !important;
            width  : 99%;
            color  : Gray;
        }
        
        .x-grid-row-expanded td.x-grid-cell{
            border-bottom-width:0px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="ExamAnalysis.Model.ExamAnalysisDataContext" EntityTypeName="" 
        TableName="SubjectInfo">
    </asp:LinqDataSource>
    <br />
    <ext:GridPanel ID="ClassInfoGridPanel" runat="server" Frame="true" Height="420" 
        Title="错因信息" Width="600">
        <Store>
            <ext:Store ID="Store2" runat="server">
                <Model>
                    <ext:Model ID="Model1" runat="server" IDProperty="ReasonID" Name="ReasonInfo">
                        <Fields>
                            <ext:ModelField Name="ReasonID" />
                            <ext:ModelField Name="ReasonName" />
                            <ext:ModelField Name="ReasonCode" />
                            <ext:ModelField Name="ReasonDescribe" />
                            <ext:ModelField Name="SubjectID" />
                            <ext:ModelField Name="SubjectName" />
                        </Fields>
                    </ext:Model>
                </Model>
            </ext:Store>
        </Store>
        <ColumnModel ID="ColumnModel2" runat="server">
            <Columns>
                <ext:Column ID="Column1" runat="server" DataIndex="ReasonCode" Text="错因编号" 
                    Width="100">
                    <Editor>
                        <ext:TextField ID="TextField1" runat="server" />
                    </Editor>
                </ext:Column>
                <ext:Column ID="Column2" runat="server" DataIndex="ReasonName" Text="错因" 
                    Width="150">
                    <Editor>
                        <ext:TextField ID="TextField2" runat="server" />
                    </Editor>
                </ext:Column>
                <ext:Column ID="Column3" runat="server" DataIndex="ReasonDescribe" Text="错因描述" 
                    Width="150">
                    <Editor>
                        <ext:TextField ID="TextField3" runat="server" />
                    </Editor>
                </ext:Column>
                <ext:Column ID="Column6" runat="server" DataIndex="SubjectName" Text="科目" 
                    Width="150">
                    <Editor>
                        <ext:TextField ID="TextField4" runat="server" />
                    </Editor>
                </ext:Column>
            </Columns>
        </ColumnModel>
        <SelectionModel>
            <ext:RowSelectionModel ID="RowSelectionModel3" runat="server" Mode="Single" />
        </SelectionModel>
        <TopBar>
            <ext:Toolbar ID="Toolbar1" runat="server">
                <Items>
                    <ext:DropDownField ID="DropDownField1" runat="server" FieldLabel="当前科目" 
                        Text="全部" Width="400">
                        <Component>
                            <ext:GridPanel ID="GridPanel1" runat="server" Height="200">
                                <ColumnModel>
                                    <Columns>
                                        <ext:Column ID="Column12" runat="server" DataIndex="SubjectCode" Text="科目编号" 
                                            Width="50" />
                                        <ext:Column ID="Column13" runat="server" DataIndex="SubjectName" Text="科目" 
                                            Width="150" />
                                    </Columns>
                                </ColumnModel>
                                <SelectionModel>
                                    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" Mode="Single" />
                                </SelectionModel>
                                <Store>
                                    <ext:Store ID="Store1" runat="server" DataSourceID="LinqDataSource1">
                                        <Model>
                                            <ext:Model ID="Model4" runat="server" IDProperty="SubjectID">
                                                <Fields>
                                                    <ext:ModelField Name="SubjectID" />
                                                    <ext:ModelField Name="SubjectCode" />
                                                    <ext:ModelField Name="SubjectName" />
                                                </Fields>
                                            </ext:Model>
                                        </Model>
                                    </ext:Store>
                                </Store>
                                <BottomBar>
                                    <ext:Toolbar ID="Toolbar5" runat="server">
                                        <Items>
                                            <ext:Button ID="Button1" runat="server" OnDirectClick="Button_Click" 
                                                Text="选择" />
                                        </Items>
                                    </ext:Toolbar>
                                </BottomBar>
                            </ext:GridPanel>
                        </Component>
                    </ext:DropDownField>
                </Items>
            </ext:Toolbar>
        </TopBar>
        <BottomBar>
            <ext:Toolbar ID="Toolbar6" runat="server">
                <Items>
                    <ext:Button ID="Button2" runat="server" OnDirectClick="Button2_Click" 
                        Text="添加错因" />
                    <ext:Button ID="Button3" runat="server" OnDirectClick="Button3_Click" 
                        Text="更改选中错因" />
                    <ext:Button ID="Button4" runat="server" OnDirectClick="Button4_Click" 
                        Text="删除选中错因" />
                </Items>
            </ext:Toolbar>
        </BottomBar>
    </ext:GridPanel>
    <ext:Window 
            ID="FormWindow" 
            runat="server" 
            Title="错因信息编辑" 
            Width="420" 
            Height="300"           
            BodyPadding="10" 
            Resizable="false" 
            Closable="True"
            Layout="Fit" AutoShow="False" HideCollapseTool="False" Hidden="True" HideMode="Visibility">
            <Items>
                <ext:FormPanel 
                    ID="FormPanel1" 
                    runat="server" 
                    Border="false" 
                    BodyStyle="background-color:transparent;"
                    DefaultAnchor="-10"
                    Layout="Form">
                    <Items>
                        <ext:TextField 
                            ID="ReasonCode"
                            runat="server" 
                            Name="ReasonCode" 
                            MsgTarget="Side" 
                            AllowBlank="false"
                            FieldLabel="错因编号" 
                            />
                        <ext:TextField 
                            ID="ReasonName" 
                            runat="server" 
                            Name="ReasonName" 
                            MsgTarget="Side" 
                            AllowBlank="false"
                            FieldLabel="错因" 
                            />
                        <ext:TextField 
                            ID="ReasonDescribe" 
                            runat="server" 
                            Name="ReasonDescribe" 
                            MsgTarget="Side" 
                            AllowBlank="false"
                            FieldLabel="错因描述" 
                            />
                            <ext:DropDownField ID="DropDownField2" runat="server" Width="400" FieldLabel="所属科目" Text="请选择">
                            <Component>
                                <ext:GridPanel ID="GridPanel2" Height="200" runat="server">

                                    <ColumnModel>
                                        <Columns>
                                            <ext:Column ID="Column4" runat="server" Width="150" Text="科目编号" DataIndex="SubjectCode" />
                                            <ext:Column ID="Column5" runat="server" Width="150" Text="科目" DataIndex="SubjectName" /> 
                                        </Columns>
                                    </ColumnModel>
                                    <SelectionModel>
                                         <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" Mode="Single" />
                                    </SelectionModel>
                                        <Store>
                    <ext:Store ID="Store3" runat="server" DataSourceID="LinqDataSource1">
                        <Model>
                            <ext:Model ID="Model2" runat="server" IDProperty="SubjectID">
                                <Fields>
                                    <ext:ModelField Name="SubjectID" />
                                    <ext:ModelField Name="SubjectCode" />
                                    <ext:ModelField Name="SubjectName" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <BottomBar>
                <ext:Toolbar ID="Toolbar2" runat="server">
                <Items>
                 <ext:Button ID="Button5" Text="选择" runat="server" OnDirectClick="Button5_Click" />
                 </Items>
                </ext:Toolbar>
                </BottomBar>
                                </ext:GridPanel>
                            </Component>
                        </ext:DropDownField>
                    </Items>
                </ext:FormPanel>
            </Items>
            <BottomBar>
        <ext:Toolbar ID="Toolbar3" runat="server">
                    <Items>
                        <ext:Button ID="Button6" runat="server" Icon="Add" Text="添加" Visible="true">
                          <DirectEvents>
                                <Click OnEvent="Add_Click" />
                           </DirectEvents>
                        </ext:Button>      
                         <ext:Button ID="Button7" runat="server" Icon="Accept" Text="更新" Visible="true">
                          <DirectEvents>
                                <Click OnEvent="Change_Click" />
                           </DirectEvents>
                        </ext:Button>              
                        <ext:ToolbarFill ID="ToolbarFill1" runat="server" /> 
                    </Items>
                </ext:Toolbar>
            </BottomBar>
        </ext:Window>
</asp:Content>
